<#include "/admin/system/metadata/detail/head.html">
<div class="layui-tab">
	<div class="layui-tab-content" style="padding:0px;">
	    <div class="layui-tab-item layui-show">
			<div class="box default-box" style="height: 100%;">
				<div class="box-header">
					<h3 class="box-title">
						CRM数据表<#if metadataList??>（${metadataList.totalElements!''}）</#if>
					</h3>
				</div>
				<div class="box-body ukefu-im-theme">
					<#include "/admin/system/metadata/detail/metadatalist.html">
					<div class="row" style="padding:5px;">
						<div class="col-lg-12" id="page" style="text-align:center;"></div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<script>
	$(document).ready(function(){
		$('#batdel').click(function(){
			var ids = "";
			$('.ids').each(function(){
				if($(this).prop("checked")){
					if(ids!=""){
						ids += "&" ;
					}
					ids += "ids=" + $(this).val();
				}
			});
			if(ids==''){
				top.layer.alert("请选择元数据！", {icon: 7});
			}else{
				$('#batdel').attr('href' , '/admin/metadata/batdelete.html?'+ids+"&tabletype=${tabletype!''}")	;
				$('#batdel').attr('data-toggle' , 'tip')	;
			}
			
		});
		
	});	
	layui.use('layer', function(){
		  var layer = layui.layer;
		  <#if msg?? && msg == 'bat_delete_success'>
		  layer.msg('批量删除元数据成功！', {icon: 6});
		  <#elseif msg?? && msg == 'bat_delete_faild'>
		  layer.msg('请勾选需要删除的记录！', {icon: 5});
		  </#if>
		});
	layui.use(['laypage', 'layer'], function(){
		  var laypage = layui.laypage
		  ,layer = layui.layer;
		  laypage.render({
				elem: 'page'
				,pages: <#if metadataList??>${metadataList.totalPages}<#else>0</#if> //总页数
				,curr:<#if metadataList??>${metadataList.number+1}<#else>0</#if>
				,groups: 5 //连续显示分页数
				,jump:function(data , first){
					if(!first){
						location.href = "/admin/metadata/crmtable/list.html?p="+data.curr +"&tabletype=${tabletype!''}";
					}
				}
		   });
		});
</script>